﻿namespace MEF_Test.Bricks
{
    using Microsoft.Practices.Unity;

    /// <summary>
    /// A convenient static class to create and access a single Unity IoC container.
    /// </summary>
    /// <remarks>This class is not thread-safe.</remarks>
    public class IoC
    {
        /// <summary>
        /// Gets the current IoC container.
        /// </summary>
        /// <value>The current.</value>
        public static IUnityContainer Current { get; private set; }

        /// <summary>
        /// Sets the container.
        /// </summary>
        /// <param name="container">The container.</param>
        public static void SetContainer(IUnityContainer container)
        {
            Current = container;
        }
    }
}
